/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.web.gwt.form.client.value;

import java.util.Map;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * interface that represents all the values of a <code>Form</code>.
 */
public interface FormValues
    extends IsSerializable
{

  /**
   * returns the identifier of the
   * {@link com.genia.toolbox.web.gwt.form.client.form.Form} associated with
   * this values.
   * 
   * @return the identifier of the
   *         {@link com.genia.toolbox.web.gwt.form.client.form.Form} associated
   *         with this values
   */
  public String getFormIdentifier();



  /**
   * returns the identifier of the object being edited.
   * 
   * @return the identifier of the object being edited
   */
  public DataIdentifier getDataIdentifier();



  /**
   * set the identifier of the object being edited.
   * 
   * @param dataIdentifier
   *          the dataIdentifier to set
   */
  public void setDataIdentifier(DataIdentifier dataIdentifier);



  /**
   * convenient method that returns the value of the form item with the name
   * given in parameters. It is equivalent to
   * <code>getFormSimpleValues().get(name)</code>.
   * 
   * @param name
   *          the name of the form item
   * @return the value of the item with the name given in parameter
   */
  public FormSimpleValue getFormSimpleValue(String name);



  /**
   * convenient method that adds a new {@link FormSimpleValue}. It is
   * equivalent to
   * <code>getFormValues.put(formSimpleValue.getName(), formSimpleValue)</code>.
   * 
   * @param formSimpleValue
   *          the form value to add
   */
  public void addFormSimpleValue(FormSimpleValue formSimpleValue);



  /**
   * returns all the values of the form items of the form associated with this
   * object indexed by their names.
   * 
   * @return the map of all the values of the form items of the form associated
   *         with this object indexed by their names
   */
  public Map<String, FormSimpleValue> getFormSimpleValues();



  /**
   * convenient method that returns the value of the form item with the name
   * given in parameters. It is equivalent to
   * <code>getFormComplexValues().get(name)</code>.
   * 
   * @param name
   *          the name of the form item
   * @return the value of the item with the name given in parameter
   */
  public FormComplexValue getFormComplexValue(String name);



  /**
   * convenient method that adds a new {@link FormComplexValue}. It is
   * equivalent to
   * <code>getFormValues.put(formComplexValue.getName(), formComplexValue)</code>.
   * 
   * @param formComplexValue
   *          the form value to add
   */
  public void addFormComplexValue(FormComplexValue formComplexValue);



  /**
   * returns all the values of the form items of the form associated with this
   * object indexed by their names.
   * 
   * @return the map of all the values of the form items of the form associated
   *         with this object indexed by their names
   */
  public Map<String, FormComplexValue> getFormComplexValues();
}
